//
//  ShopHeadCollectionReusableView.m
//  FaceTo
//
//  Created by 程邦明 on 2017/8/7.
//  Copyright © 2017年 chengbangming. All rights reserved.
//

#import "ShopHeadCollectionReusableView.h"

@implementation ShopHeadCollectionReusableView
- (id)initWithFrame:(CGRect)frame {
    self = [super initWithFrame:frame];
    
    if (self){
        [self initUI];
    }
    return self;
}
- (void)initUI{
    self.backgroundColor = WhiteColor;
    
    _headImage = [[UIImageView alloc]init];
    _headImage.image = [UIImage imageNamed:@"useicon"];
    [self addSubview:_headImage];
    
    _namelabel = [[UILabel alloc]init];
    _namelabel.font = [UIFont systemFontOfSize:15];
    _namelabel.textAlignment = NSTextAlignmentLeft;
    _namelabel.textColor = Color(51, 51, 51);
    _namelabel.text = @"商家名称";
    [self addSubview:_namelabel];
    
    _addressLabel = [[UILabel alloc]init];
    _addressLabel.font = [UIFont systemFontOfSize:14];
    _addressLabel.textAlignment = NSTextAlignmentLeft;
    _addressLabel.textColor = Color(51, 51, 51);
    _addressLabel.text = @"商家地址：江南大学北区商业街二楼1212号";
    [self addSubview:_addressLabel];
    
    _phoneLabel = [[UILabel alloc]init];
    _phoneLabel.font = [UIFont systemFontOfSize:14];
    _phoneLabel.textAlignment = NSTextAlignmentLeft;
    _phoneLabel.textColor = Color(51, 51, 51);
    _phoneLabel.text = @"联系电话：1501235612";
    [self addSubview:_phoneLabel];
    
    UIView * lineView = [[UIView alloc]init];
    lineView.backgroundColor = Color(245, 245, 245);
    [self addSubview:lineView];
    
    [_headImage mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.offset(10);
        make.top.offset(30);
        make.width.mas_equalTo(60);
        make.height.mas_equalTo(60);
    }];
    
    [_namelabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_headImage.mas_right).with.offset(10);
        make.top.equalTo(_headImage.mas_top);
        make.height.mas_equalTo(16);
    }];
    
    [_phoneLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_headImage.mas_right).with.offset(10);
        make.bottom.equalTo(_headImage.mas_bottom);
        make.height.mas_equalTo(15);
        
    }];
    
    [_addressLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.equalTo(_headImage.mas_right).with.offset(10);
        make.bottom.equalTo(_phoneLabel.mas_top).with.offset(-5);
        make.height.mas_equalTo(15);
    }];
    
    [lineView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.bottom.equalTo(self.mas_bottom);
        make.left.offset(0);
        make.width.mas_equalTo(kSCREEN_WIDTH);
        make.height.mas_equalTo(7);
    }];
}
@end
